<%@ page import="com.wuming.house.security.SecurityHander" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/share/taglib.jsp" %>
<html>
<head>
    <meta charset="utf-8">
    <title>用户信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${allServerPath}static/layui/layui/css/layui.css" media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body style="background-color: #f0f2f5;">
<div style="padding: 15px;margin: 15px;background-color: #fff;">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>用户基本信息</legend>
    </fieldset>
    <form class="layui-form" id="saveUserFrom">
        <div class="layui-row">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">用户名</label>

                    <div class="layui-input-inline">
                        <input name="userName" class="layui-input" type="text" autocomplete="off" placeholder="请输入姓名"
                               value="">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">密码</label>

                    <div class="layui-input-inline">
                        <input name="password" class="layui-input" type="password" autocomplete="off"
                               placeholder="请输入密码"
                               value="">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">所属单位</label>

                    <div class="layui-input-inline">
                        <input name="company" class="layui-input" type="text" autocomplete="off" placeholder="请输入所属单位"
                               value="">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">手机号码</label>

                    <div class="layui-input-inline">
                        <input name="phone" class="layui-input" type="tel" autocomplete="off" placeholder="请输入手机号码"
                               value="">
                    </div>
                </div>
                <div class="layui-inline">

                    <label class="layui-form-label">状态</label>

                    <div class="layui-input-inline">
                        <select name="status" id="statusId" lay-verify="statusId">
                            <option value="0">无效</option>
                            <option value="1">有效</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">

                    <label class="layui-form-label">角色</label>

                    <div class="layui-input-inline">
                        <select name="role" id="role" lay-verify="role">
                            <option value="1">驾校管理员</option>
                            <option value="3">前台</option>
                            <option value="4">财务</option>
                            <option value="5">教练</option>
                            <option value="6">校长</option>
                            <option value="7">报名点管理员</option>
                        </select>
                    </div>

                </div>
            </div>
        </div>
        <div class="layui-row" style="text-align: center;">
            <button class="layui-btn layui-btn-normal" type="button" name="btnSave" id="saveUser">保存信息</button>
        </div>
        <input type="hidden" name="userName122" value="<%=SecurityHander.getCurrentUser().getUserName122()%>"/>
        <input type="hidden" name="password122" value="<%=SecurityHander.getCurrentUser().getPassword122()%>"/>
        <input type="hidden" name="parentId" value="<%=SecurityHander.getCurrentUserId()%>"/>

        <input type="hidden" name="authloginurl" value=""/>
    </form>
</div>


<script src="${allServerPath}static/layui/layui/layui.js"></script>
<script>
    layui.use(['form', 'layedit', 'laydate', 'jquery'], function () {
        var form = layui.form
                , layer = layui.layer
                , $ = layui.jquery;

        $("#saveUser").click(function () {
            $.ajax({
                type: "post",
                url: "${allServerPath}/web/member/save.htmls",
                data: $('#saveUserFrom').serialize(),// 你的formid
                dataType: "JSON",
                success: function (data) {
                    if (data.success) {
                        layer.msg("保存成功.");
                    } else {
                        layer.msg("保存失败,请稍后重试.");
                    }
                },
                error: function (msg) {
                    layer.msg("保存失败.");
                }
            });
        });
    });
</script>
</body>
</html>
